{
 "cells": [
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "This notebook is intended to demonstrate how vessel segmentation methods of ITKTubeTK can be applied to segment vessels passing through specific voxels."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "metadata": {},
   "outputs": [],
   "source": [
    "import itk\n",
    "from itk import TubeTK as ttk\n",
    "\n",
    "from itkwidgets import view\n",
    "\n",
    "import numpy as np"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "metadata": {},
   "outputs": [],
   "source": [
    "ImageType = itk.Image[itk.F, 3]\n",
    "\n",
    "im1vess = itk.imread(\"../Data/MRI-Cases/mra.mha\",itk.F)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "metadata": {},
   "outputs": [],
   "source": [
    "res = ttk.ResampleImage[ImageType].New()\n",
    "res.SetInput(im1vess)\n",
    "res.SetMakeHighResIso(True)\n",
    "res.Update()\n",
    "im1iso = res.GetOutput()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 6,
   "metadata": {},
   "outputs": [],
   "source": [
    "xp1=[-3.9,-54.8,12.3]\n",
    "xp2=[18.4,-16,-21]\n",
    "xp3=[-46,-15,-13]\n",
    "\n",
    "vSeg = ttk.SegmentTubes[ImageType].New()\n",
    "vSeg.SetInput(im1iso)\n",
    "vSeg.SetVerbose(False)\n",
    "vSeg.SetRadiusInObjectSpace( 0.33 )\n",
    "vSeg.SetMinRoundness(0.2)\n",
    "vSeg.SetVerbose(True)\n",
    "tube = vSeg.ExtractTubeInObjectSpace( xp1, 1 )\n",
    "tube = vSeg.ExtractTubeInObjectSpace( xp2, 2 )\n",
    "tube = vSeg.ExtractTubeInObjectSpace( xp3, 3 )\n",
    "tubeG = vSeg.GetTubeGroup()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 7,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "[0.9476970880991076, 0.9495690175696083, 0.9266045644116354, 0.9367415567502634, 0.9155456729334054, 0.9213089192308838, 0.05176911784905983, 0.9391687288692704, 0.9384839625170907, 0.9606947909606186, 0.9582234405369334, 0.9611833306558912, 0.36401733678689396, 0.37340907325503025, 0.38483192749684514, 0.39505296606961043, 0.404485075871499, 0.4214139959928322, 0.5813682044136994, 0.9425720597055746, 0.9388275823783475, 0.837780040382554, 0.5486228132292076, 0.5954474236158476, 0.5834204618487692, 0.6080738986393774, 0.874378739619728, 0.9311981977165955, 0.7575598765394175, 0.9060316618735894, 0.6978052949619998, 0.8608796275716065, 0.8223879381650364, 0.8394487738942488, 0.22139601719854918, 0.07743398044471152, -0.024163553441872127, -0.16960091654091336, -0.3546832216099779, -0.2399673675262435, -0.380246384781714, -0.3796410194269799, -0.902100574860639, -0.8030052934423455, 0.17043773833620232, 0.7936997414336965, -0.4308000859686011, 0.46682757964753885, 0.5141901074183847, 0.5588165954998054, 0.6001479097531284, 0.6376469013483795, 0.668911660932327, 0.639995190107671, 0.8538395803369283, 0.8102997835933424, 0.8347675299559827, 0.8659951795006025, 0.8703396685478366, 0.8892968892943396, -0.06091804151276911, 0.12318333701361696, 0.28413773980165435, 0.3492692439466208, 0.4353448260138505, -0.36642055995453604, -0.9097510234363648, -0.9064421741799952, -0.6692202299288549, -0.6838406662281911, -0.6824745468558678, -0.6808800541478008, -0.6791116722788529, -0.6772352408052941, -0.6752633021384158, -0.6732304902806834, -0.6697969726212557, -0.6208584552215768, -0.8320888189786867, -0.7230204407657064, -0.7790545655696977, -0.6577045328955717, -0.6578586512158525, -0.2694360106023361, -0.6823570334056013, -0.7222175112365713, -0.6853328460949185, -0.7728895308907942, -0.6388152449883422, -0.652510600270797, -0.6336648973678649, -0.8049000986548993, -0.7326220843654228, -0.7661627957102998, -0.5998098697910272, -0.641433926411514, -0.6769252623744992, -0.7035112538108561, -0.7237182250480574, -0.7392746110557333, -0.7514917507916026, -0.7612554112146402, -0.7694135893496458, -0.7842355040279688, -0.6976046847651322, -0.7630301467731165, -0.8503057198062401, -0.6510196588884081, -0.5819696494016006, -0.7742444800406819, -0.7921180369832053, -0.8016466886925085, -0.8090020311007912, -0.8145564034277596, -0.8186418047858685, -0.8215476974857656, -0.8235221078945143, -0.8247742548496038, -0.8254743090203649, -0.8258428144224049, -0.7642771833674687, -0.8302735701069062, -0.8286692496310843, -0.016223437889117603, 0.6504479465835048, 0.7962939302487296, 0.6700696989921575, 0.8271243970085803, 0.826956022443474, 0.8267956731947387, 0.8266821159921891, 0.826606616041548, 0.8265586968143063, 0.8265292650362753, 0.8265107972951046, 0.8264962411924859, 0.8264802580982541, 0.8264589335427145, 0.8264351564702829, 0.8270356068489463, 0.3466802884315178, 0.8312400585550841, 0.2267843833034377, 0.8011411152694281, 0.7958781047253524, 0.7902535980865214, 0.784009054526692, 0.7770736996015197, 0.7693575649961816, 0.7607894353929379, 0.751282169493594, 0.7407480204689408, 0.7290926856539917, 0.7155165955155829, 0.3012886539514973, 0.6391641769994161, 0.8016937990027516, 0.7690834629350627, 0.7396308966161892, 0.7881335695941094, 0.7967107342765506, 0.7963381620443523, 0.7962082192508747, 0.5780372412737771, 0.7463775109172301, 0.8396649526851235, 0.7684141657832972, 0.08300922171089413, 0.7983162895415397, 0.6901235255471849, 0.7782630366056258, 0.7747425003225432, 0.7744368692770007, 0.7749437474353096, 0.43790745093286704, 0.8169087420639572, 0.143810243182994, 0.519262645961327, 0.4768890036002172, 0.43779174517036623, 0.49741502454691444, 0.42993109658822853, 0.3359933738354525, 0.35733501397836137, 0.31925568601606397, 0.2782766893158404, 0.23841126234033214, 0.20036800528110885, 0.15934747143248226, -0.04192639860959547, 0.15975834467253894, -0.4977744126593706, 0.11522815462455396, 0.08873629560544785, -0.5638987561806602, 0.12067285912642704, -0.138158888071801, 0.025320943661803295, 0.002722641920562605, -0.0186758957168081, -0.03574487771329347, -0.014072416587230309, -0.13293176342464202, -0.06619652246543462, -0.10012256264125823, -0.17194741623028403, 0.11253078624970173, 0.027172533252917856, 0.046859405136636244, 0.07210569119432873, 0.0603767572642528, -0.15849494554190793, -0.03510216719729828, -0.037389506924080544, -0.03673605444916994, 0.14389090586780495, 0.13735657437648655, 0.12957496982938274, 0.12103744315033964, 0.11332411381290004, 0.09565352203168757, 0.19809275991591682, -0.0032312847957034463, 0.06561731245179643, 0.0013631826585682638, -0.09941326691695504, -0.0922855435323317, -0.08468152525788321, -0.07798559581793552, -0.05081198151348591, 0.01295948051782949, -0.034044569402938527, 0.0011703132976317674, 0.05619537305461786, -0.05878715089803426, 0.19214705010393707, 0.19146862012811633, 0.19260708096242166, 0.19380885119152927, 0.19502094629179484, 0.19580025537865675, 0.20376497558666673, -0.004130411530008328, 0.20752603472091247, -0.13845440375625856, 0.016715769491194087, -0.11488245972581228, 0.14000349830936765, 0.1407114292215016, 0.1424270051049805, 0.1450259557577569, 0.14618744076964366, -0.006173221500357526, 0.19216758027399655, -0.17379812400632816, 0.12167269398379438, 0.12844030659003128, 0.13630607790271929, 0.1446482084476389, 0.15347783726785, 0.1627952719587786, 0.1725614690693747, 0.14427390908672064, 0.21603024644728505, 0.2932596448763564, 0.2551402854077533, 0.2640832533008895, 0.2670705218089417, 0.2698002768240556, 0.27221833064224066, 0.22685685962450444, 0.27273131490429087, 0.3013385702067725, 0.3295334272797775, 0.2307630264011163, 0.14926279528949443, 0.26171308012452044, 0.0015300340451980135, 0.25383342072602144, 0.3306091980118923, 0.2837258116461817, 0.2848710902138089, 0.2851618275123206, -0.3189296809573329, -0.27503374451908347, -0.24875924730220508, -0.2891154178059795, 0.32273810027863586, 0.3271062417507101, 0.3351230519975748, 0.3464921186768722, 0.36060981631578726, 0.37662832994873596, 0.39452325084860335, 0.37696663407344955, 0.4714586893026056, -0.0261551817816987, 0.34795219183537146, 0.32907481949114176, 0.3360578502952215, 0.34204795983950403, 0.3471610185940777, 0.35150949551324595, 0.35304289352210777, 0.5112809718333919, 0.23969651065171918, 0.510766310991931, 0.4974502145792662, 0.009404278148303262, 0.4068422259247691, 0.4061389786532694, 0.40580216016300935, 0.40718419827729696, 0.41000408855562315, 0.4138967628021942, 0.418450418948807, 0.42324216207371956, 0.4283047021866396, 0.4966764663834668, 0.3926352602880311, 0.40476707923634214, 0.5689950826466563, 0.5690379294333067, 0.5614263054768981, 0.49546647654484205, -0.2820072295712329, 0.4868261956246792, 0.531770498811771, 0.5239295477254002, 0.5134027490580374, 0.5304418992982424, 0.4998076104753873, 0.5003654660708222, 0.5558139578584974, 0.5554974767183113, 0.5539947636192194, 0.5526047767215374, 0.5513643724926311, 0.5502769473155307, 0.5493578133746597, 0.5486596492149775, 0.5482004932466403, 0.5410028336512908, 0.5494661902887168, 0.2844700147718126, 0.5774407349023153, 0.5414702259577849, 0.5088085872675638, 0.494950058424424, 0.48308906380201944, 0.4703103746668688, 0.4565044969953281, 0.44158164626490876, 0.4253783960282973, 0.42845395975661044, 0.38546964856230764, 0.3642757851491757, 0.422382817449265, 0.430836501885756, 0.4129904359837593, 0.3960601149646591, 0.37837158257037673, 0.3555188672864771, -0.28174515741298567, 0.5018332674748067, -0.4890656474702425, 0.47117978706637714, 0.5127567819432147, 0.44192091345416357, 0.34316999862186565, 0.39263530866296154, 0.37579055327277666, 0.35797429216660837, 0.3387950342882946, 0.31811935221310395, 0.29603934038826796, 0.2720003011419642, 0.18194928468622204, 0.20055031601757475, 0.20291411975806428, 0.14426119930888323, 0.1649261415823155, 0.2957679097979014, 0.4962980208441244, 0.6164785781303714, 0.6300888888334406, 0.6422125020601251, 0.6520884927129622, 0.6592269498109463, 0.6635864486619497, 0.6655661617383143, 0.6658499276331379, 0.6637735040448861, 0.6608026514664893, 0.5585439221868741, 0.5001269421333497, 0.5484994322106526, 0.5877596601074597, 0.5911477494954525, 0.592594919482888, 0.5932750510682467, 0.592933299598431, 0.591125996069476, 0.514570316111852, 0.6813078358251138, 0.281277184215867, 0.6943264444107969, 0.5321093943501436, 0.3811206568296183, 0.277001462435675, 0.590643525037956, 0.6936264203421014, 0.6935636492577667, 0.6933536527201589, 0.692983546348437, 0.6924424129620971, 0.6917208849912427, 0.6908248947187315, 0.6897419406331682, 0.6884918624963774, 0.6871938353398226, 0.3383927640907104, 0.6901931268194323, 0.7008589931575668, 0.28614368469568335, 0.5096524741320895, 0.5134671752995745, 0.5169124559300574, 0.5200539410468723, 0.5229737185470423, 0.525725791627599, 0.5283774626452942, 0.5309998481218785, 0.533634912783963, 0.5363596037033752, 0.5554198311287553, 0.5552255282901453, 0.6274640609998392, 0.6794015732148865, 0.657863814545844, 0.6619785112361493, 0.6676323229619553, 0.6725437059005451, 0.7305793730618547, 0.4311910625895593, 0.7539358990262796, 0.43927308099515855, 0.7482288350358901, 0.7356889080302909, 0.7447494936431491, 0.7493959361009666, 0.7486546634990081, 0.7480109916477595, 0.7467083476325148, 0.7480486875778679, 0.749212296456283, 0.7498972624220688, 0.7503702882035099, 0.7506994249484473, 0.7509315019262636, 0.7511010769039685, 0.7514091482111218, 0.75157884994473, 0.7164763561638222, 0.5662236983090377, 0.4727411878717762, 0.4245388166183443, 0.41109202429541236, 0.538610461111775, 0.6373755447356462, 0.07611118853622238, -0.0744947497819931, -0.21318834398366018, -0.33627882358016625, -0.44142189899601025, 0.06522662306900477, -0.7142957794497644, -0.6614310508572676, -0.6212874107723166, -0.6191323536890944, -0.6226578461679095, -0.6279172717495607, -0.6837309141747492, -0.7741091200716361, -0.7772348040982152, -0.5670733775510167, -0.7552848975349696, -0.618195059112314, -0.7539872599917912, -0.7134968833786312, -0.6605821799528826, -0.7110129111235824, -0.693667492024821, -0.6845222640719576, -0.6752299322768781, -0.6660257701478489, -0.6568263101066767, -0.7488614364423868, -0.6817749383913737, -0.48258937839600763, -0.7598825254240301, -0.6967369249040204, -0.7695719864039711, -0.6864434733954137, -0.7662359719440223, -0.7639637002078103, -0.7597966900092361, -0.7520992789934943, -0.7377544318357926, -0.710192260578201, -0.6546430586675657, -0.5378430984292751, -0.2537426421086528, -0.11203411488897819, 0.27733224112742394, -0.0213249515121409, -0.060319926931506895, -0.6622139838507188, -0.7065918399879038, -0.7146952432001681, -0.7209650565154291, -0.7260426115823211, -0.7303455479307953, -0.6996257416743978, -0.6901932609625919, -0.751300925879941, -0.7180001329926402, -0.6601888026994741, 0.33671632114186123, 0.5918212274444893, -0.23720531562375763, -0.7405912769931746, -0.7239805767180878, -0.7279584328739765, -0.7319747339158915, -0.7359664717780546, -0.7398551529583023, -0.7435424033701006, -0.7468884729714216, -0.7497672289387485, -0.44934074144625025, -0.7561832830508161, -0.6779311873472981, -0.6411607231549727, -0.6775316753127493, -0.5884932369440128, -0.3489950646361198, -0.7485893972285079, -0.7475457435338476, -0.7452566016336907, -0.7425858956633701, -0.7395728982774576, -0.736275593174765, -0.7328192350164916, -0.7570900479234531, -0.7366695509052855, -0.7221748974579065, -0.7183336715576801, -0.6448777221678811, -0.7447861116144155, -0.733076505940255, -0.7024557074579171, -0.662490553574094, -0.619570263482446, -0.5148219012411506, 0.5883848552072923, -0.5210333015441092, -0.3119362955638693, -0.27252448177320765, -0.2533107803766055, -0.2294846283986431, -0.21411810578906063, -0.20402562779167194, -0.19832740177151828, -0.1958522104160967, -0.11877134261184927, -0.21891838855683396, -0.3226246700439127, -0.1646934965585991, -0.11552380210075486, -0.20520111756603393, -0.2619623453205096, -0.4066017784338009, -0.3023524463110748, -0.22680860765900215, -0.1479357500875024, -0.06525468039324414, 0.02157967000134457, 0.11310162393718876, 0.20935669338184515, 0.30880130744927975, -0.6566736479518855, -0.7544776180338998, -0.7304513627040612, -0.23630266877666994, -0.28498249175539575, -0.30300170815516875, -0.4209613859492141, -0.5276074079307295, -0.6091295048768384, -0.6646850855048032, -0.6998162731020102, -0.721486996295028, -0.6266964580844191, -0.5909003516955678, -0.22340075306648757, -0.5848034744737676, 0.33675581480573696, -0.34755226552077645, -0.28967666943182724, 0.5240902099874801, -0.3801572209299853, -0.41723762678023124, -0.4464944973460133, -0.470106338884968, -0.48948136247299046, -0.5056741728085, -0.5193608426691085, -0.5307901224231628, -0.2317802415667711, -0.49901164216430227, -0.6972642393114427, -0.2208844073270533, -0.2979074375524921, -0.4135865346950094, -0.6464682623250121, -0.6865590488824171, -0.7066619239083147, -0.7069457621076835, -0.6835247525232155, -0.707089554845102, -0.7064413058722253, -0.7060877477434202, -0.7059622204609507, -0.08486443695631114, -0.6239475796889661, -0.6646927679567601, -0.40207133604219303, -0.42658477016170754, -0.4702757045910167, -0.5006497994221151, -0.5262022849416955, -0.5487371839871148, -0.6669574508892272, -0.4278541295046598, -0.48035287050135006, -0.4079694894813343, -0.32670018898172376, -0.5809738307584896, -0.6804605982816093, -0.46832081583674157, -0.4424045380862382, -0.21107021124588649, -0.42371544415450424, -0.5012665625160394, -0.560121515568798, -0.547521459528798, -0.5344585980195388, -0.5220841479375434, -0.5106965530373753, -0.5002929919216902, -0.21074456373076372, -0.5643453866035727, -0.6314705240011267, -0.5738590538478268, -0.5872191479179429, -0.597916406926737, -0.6066854710090254, -0.33722117074421626, -0.6322495055496525, -0.6185639822012655, -0.5892597446934144, -0.5721488022753657, -0.5678602074445965, 0.12011618439336487, 0.6432105450316347, 0.5296080427647359, 0.09600293203989073, -0.4649799591324185, -0.4742504427517754, -0.48098747923855517, -0.4871374480276987, -0.4927422072893237, -0.4802104762278653, -0.360623833842988, -0.42954108477959335, -0.3792779689374613, -0.5168305622421864, -0.5829577081278544, -0.5897721298333266, -0.5989860750509248, -0.5989827378707059, -0.5990048686006669, -0.5990430496284403, -0.5990873601277537, -0.5991208776988273, -0.5991221088086633, -0.5990623606278866, -0.5992329913575419, -0.032030935057026574, -0.32642210148083856, 0.2793258549791364, -0.2781173116974891, -0.26227802186077287, -0.2593339820690201, -0.5265056134532928, -0.2949412802582244, 0.05458967876181406, -0.35663125224961023, -0.353271280092038, -0.34127812363969007, -0.47423747238395714, -0.48745449869571855, -0.4701249171099666, -0.4850496760958401, -0.48495780650507236, -0.48498721590728405, -0.48524304051042627, -0.4858216200934804, -0.48683120703552957, -0.48851917196380223, -0.4897559924302237, -0.18649113333619108, -0.3440070135717338, 0.11572408881645821, -0.38795490279512285, -0.35541440141885416, -0.345703866985432, -0.3002937679055858, -0.30162022270751243, -0.33263814452130963, -0.1327200357202691, -0.05849013152300499, -0.05096279555315522, -0.02442062447380177, -0.1338288040307438, -0.10689113997650962, -0.08509800205368506, -0.06534174465896604, -0.047723906246387955, -0.032264070164969856, -0.018638524071866103, 0.003629101797495587, -0.05187078280503127, -0.016597925938746854, -0.045478075169920626, 0.14587008973568252, 0.11208258637961353, 0.08527501651658229, 0.06507467025174293, 0.04997761330839721, 0.03871073006651988, 0.02021108624065356, -0.005331537120485667, 0.11202564831237853, -0.06440225854725502, 0.12963280637000724, 0.12798808751221558, 0.12603902756366483, 0.12374429998172949, 0.1210432650550454, 0.11797545202328248, 0.09622288019994392, -0.003259138202765017, 0.23706871663041662, 0.08483606249486422, -0.2029505374756973, -0.1726482254285974, -0.24183432469635258, -0.19661246712476801, -0.20381329532421832, -0.21058033578713273, -0.21581255592456153, -0.07567884404769146, 0.007481724153479972, 0.21258041660611154, 0.26347690586884176, 0.17143880479586288, 0.16789353381802657, 0.16733344114462198, 0.16661442483368066, 0.16564534783443302, 0.16515499883529933, 0.2751461976454935, 0.2483596545432432, 0.23677902962927383, 0.3030308121662029, 0.30092455109467864, 0.3019966182564782, 0.3027427335880603, 0.303253715995065, 0.30359578816247806, 0.3038316958155954, 0.0875254041873213, 0.30991796386239956, 0.2877716960359646, -0.10418354497428807, -0.09070026418962712, -0.10158179729083128, -0.11327815369976506, -0.12575157475822124, -0.13893457451696975, -0.15274263738932983, -0.1754188056240848, -0.3695101053784201, -0.29416002533627617, -0.38002050107752, -0.3789853045351678, -0.3449457161762845, -0.3791858498800565, -0.39557661554195483, -0.38976266723123415, -0.38788554728814806, -0.3857400106213699, -0.39171689177336383, -0.38236410724010994, -0.38626395223560755, -0.3328942079553603, -0.2844476128894108, -0.2905493009988858, -0.2969045005289991, -0.30343200343571664, -0.31002024904107706, -0.316538984024039, -0.32285114816234345, -0.3510394503309953, -0.33376360180098147, -0.3289210266618091, -0.3743779572699581, -0.383713386382891, -0.38795002473496676, -0.3921643642731915, -0.36177649239428816, -0.40065155817111886, -0.42201023497080825, -0.3815248198947655, -0.411198237458671, -0.39915471202466185, -0.3877490561756019, -0.41961004924686507, -0.4237819476565967, -0.42697881047096886, -0.4297082827824033, -0.43783934612994424, -0.2994898803575584, -0.39525164307936994, -0.33709322080752685, -0.4294776405385306, -0.43234190685434726, -0.46550858468820755, -0.4925618919852539, -0.4888781853579126, -0.48929330829562284, -0.48308571874843204, -0.4905267878719631, -0.49145267838467166, -0.32016087632849227, -0.2776886775739347, -0.2721318884569564, -0.2792521630903093, -0.2590312253700997, -0.23022762481682446, -0.22176371133714212, -0.21892006984090834, -0.21810841109637266, -0.2182086035002064, -0.21930002875013407, -0.22146374929946663, -0.22478407507917542, -0.22935063819631402, -0.23452346341746685, -0.2567208128622589, -0.4943833839459789, -0.2684110533279297, 0.04844168473982137, -0.29967234037697654, -0.295906090818296, -0.30138939471818876, -0.30796955423993017, -0.3159090714264175, -0.3255356021474341, -0.337155611437064, -0.34856928803629106, -0.5340101370832595, 0.25593146939607764, 0.5967000315660594, 0.21071672762664495, 0.6027657080416028, 0.6083377178343101, 0.37940640144280946, 0.6215264466931798, 0.6048561857093888, 0.569227858661797, 0.5459587293496135, 0.5552389043621418, 0.6150120049899249, -0.060604931030506765, 0.6199771880937529, 0.2886791793122559, 0.5437093582195982, 0.5361148450779565, 0.5365280209321812, 0.5362664988978457, 0.535554290146078, 0.5345836050040549, 0.533539691141834, 0.532496203404118, 0.46093587757624704, 0.5086409452333788, 0.6779286544940162, 0.450132105370765, 0.5241667574427776, 0.6893721201740273, 0.6932965786355909, 0.693615140905526, 0.6936603100675375, 0.6936890630477355, 0.6936795837456542, 0.6936010982548484, 0.6934126269258327, 0.6930614282286287, 0.6924803130880492, 0.6916485832914187, 0.6911941770426993, 0.692794226753218, 0.5940765784449731, 0.6809637834213668, 0.7031365514187158, 0.4048552872239346, 0.29694720517211387, 0.3106622870208594, 0.3209239146833436, 0.3287841944705562, 0.3349160978049489, 0.3400049525307682, 0.34451337289847855, 0.3488037727014788, 0.35324030698405035, 0.3561084108326972, 0.36581350662569784, 0.4039077431304738, 0.48519336623812426, 0.5313024687644612, 0.5401425728497764, 0.5410154833530499, 0.5354615464345174, 0.5435973549073967, 0.504145258998906, 0.3852236286214273, 0.31779945291485845, 0.3106988366809575, 0.30811304334548045, 0.30644643163254615, 0.3060473580174867, 0.3079731052774012, 0.3141323698392205, 0.38984667615338564, 0.5914379479936639, 0.6848671746050565, 0.6948936916808708, 0.7015218425623447, 0.708182338874679, 0.712927383266695, 0.7161890380049553, 0.7571136417710228, 0.714954535869263, 0.8039246408953207, 0.5043996849421035, 0.5788273158159258, 0.392547352155664, -0.4311049527223829, -0.34384852937775, -0.49138985452934186, -0.7014273445966972, -0.17724155641008202, 0.2932695542726509, 0.355275325680589, 0.4042776921630351, 0.44581186330622896, 0.4813845821041624, 0.5124845694276816, 0.5399989172871416, 0.5643277802372976, 0.5862988926061817, 0.6062485650117525, 0.6243981523369048, 0.6034793160695662, 0.6539996154036082, 0.037857442450984866, 0.6159722790245391, 0.8201006503174684, 0.7403570604540274, 0.3930202107220113, 0.3799461788182156, 0.372042738226881, 0.3684025506050563, 0.3682834038916022, 0.371000973506416, 0.3764349425612922, 0.38431536758662027, 0.39487567836153253, 0.5154762787584762, 0.4432761293832565, 0.6299126020621079, 0.8170222191032562, 0.7934102333491139, 0.8169228426402723, 0.8035622519495594, 0.8035517210007755, 0.8147685672932399, 0.6038597799403961, 0.8113686625157369, 0.8115674891748222, 0.7250200703690828, 0.7206086769233503, 0.7291127397210989, 0.7197934391275601, 0.6962469105176836, 0.6860526046350608, 0.6850095291380434, 0.6849948254479786, 0.6849759562896942, 0.6850356177011673, 0.8029103613577271, 0.690530823355355, 0.5968480237932191, 0.7486361862071146, 0.7329125779853344, 0.6862989659198614, 0.6244900519421798, 0.5858601195058832, 0.565017301250334, 0.5117175388072884, 0.45638097038220254, 0.3928529499564721, 0.19611796210551813, 0.2684615609063526, 0.20826534360729407, -0.22263300989360643, -0.3839584436529357, -0.5029233136699153, -0.6007559089343127, -0.8255739483963144, -0.8289419258135206, -0.8378856764273763, -0.6389462611814631, -0.8413916992379394, -0.7345168774536229, -0.7554793592567612, -0.775500024610693, -0.7942742429545779, -0.8112414460190958, -0.8256340290866009, -0.8365308968012013, -0.8429465701912601, -0.8440095345620675, -0.8308883310261754, -0.712541128191196, -0.6568086188700073, -0.6928280391226379, -0.7037645930371365, -0.8315013211715816, -0.4134949986719619, -0.8411015523457414, -0.851244392507604, -0.849384432499665, -0.8467306114991645, -0.8431419448119709, -0.8383978938676188, -0.8401540022669785, -0.8232448098045921, -0.7778014614013907, -0.7575912464318221, -0.7318846857350626, -0.7141035040866919, -0.695316809706674, -0.6756892201620552, -0.6562712517715795, -0.5684004160648006, -0.6222926319700783, -0.8726960523510509, -0.6918616711878716, -0.449118831627092, -0.6826022508631573, -0.8776021402647819, -0.8176569256526471, -0.87640086574168, -0.6497187353391405, -0.5143943968942183, -0.4221646497764161, -0.3025344727017467, -0.15539294643230853, 0.010981560690510012, 0.18016818718784652, 0.3319897041264929, 0.8343254205883498, 0.3354373794311545, -0.6333797360924976, -0.31989797712072127, -0.39988821059287344, -0.20796207284705948, 0.15646471105979112, 0.3893475420100257, 0.49590353370212403, 0.7226632511941721, 0.8454267544324532, 0.8308101487180263, 0.8273914724669592, 0.8267973158109152, 0.8285654307350535, 0.8321899832643062, 0.8369493594676035, 0.6631633826660571, 0.8458590330965357, 0.8913604786535992, 0.8771700871312668, 0.8042332818722436, 0.8719421748707616, 0.8684587614980349, 0.8704748380298052, 0.8724707653514193, 0.8745268280421493, 0.876682756743509, 0.8542282369321909, 0.8964489606577105, 0.7338712302225179, 0.8987775162504341, 0.6954838149653702, 0.5689329633608388, 0.8972421764636952, 0.40155203804141043, 0.6400207195560419, 0.7971144555881904, 0.768998372077965, 0.7461169924119836, 0.7185034065347272, 0.6850719201519958, 0.6446927029873987, 0.5963335167039949, 0.5388124610909927, 0.4715929310923825, 0.39475511696760623, 0.3091178858895047, 0.11887489614512685, 0.14696019774040844, -0.25456821293838044, -0.5434246932161071, -0.5575000950606406, -0.19778639336039683, 0.6380043856333779, 0.8157618613642384, 0.7150251954783766, 0.7195327215085173, 0.7242303152168942, 0.7291721382198064, 0.7343434259190275, 0.7398216526121165, 0.74558128813396, 0.7551914036841592, 0.7504112131376961, 0.6994878186636492, 0.6558862812340034, 0.6908520353715492, 0.3662094212400233, 0.8991652759163985, 0.8874805825436555, 0.8986947640948861, 0.4400451442577504, 0.4240173114873711, 0.4102331524530749, 0.39892965022133936, 0.3945071497481687, 0.5113823954386121, 0.8914345977602406, 0.8465967125247214, 0.8659731664710995, 0.5834131051258702, 0.5997088898319138, 0.6372477053858786, 0.7347097643182626, 0.8053895208383836, 0.8870092116990439, 0.8975714984230257, 0.8874737982920681, 0.8744739906802015, 0.8595376498002179, 0.8430363512319246, 0.8308176302464001, 0.8066521987864701, 0.782613641948655, 0.6164366508881481, -0.05086345590339561, -0.17654249523192164, -0.23952426656617196, 0.8530969059990003, 0.3929292106381522, 0.13486374557009426, 0.34902490389018975, 0.6573436330111284, 0.6647369828612615, 0.6535742455732443, 0.641646083403577, 0.6287228991024016, 0.6112149021079845, -0.21258212128094703, -0.7286273447635649, -0.20757981632056868, -0.12423760561267519, -0.2508572617436732, -0.37061854466216254, -0.4763048577501985, -0.7289823973303503, -0.424196479777734, -0.8851662886403315, -0.8781723269465243, -0.8695661508560194, -0.858973045432795, -0.8812335961766398, -0.8864897120122872, -0.8832097824741988, -0.7209549363647895, -0.6601799499445854, -0.6060140542882332, -0.6135494583835903, -0.62901956792095, -0.6530646867861113, -0.6855319318377228, 0.16164813221580807, -0.8608268475774622, -0.8838207564417219, -0.882896329041912, -0.8833084335099798, -0.8836854228214391, -0.8840015920914904, -0.8841338434711958, -0.8688434403280324, -0.8606543134748696, -0.6485767257296592, -0.2697358017935515, -0.8752387806586818, -0.7715934946038281, 0.024260150517520167, 0.30953784299204107, -0.6647217676558345, 0.37833510720098595, -0.12818749337818833, 0.32466681418200327, -0.687589380901161, -0.6718831212722848, -0.6564924611561969, -0.6414827909184233, -0.6270556314612539, -0.6355156639004654, -0.5011502445047123, -0.8471970534225842, -0.8089197179282585, -0.8053008519739846, -0.7460588200543743, -0.22404736615662163, 0.37070452412986227, 0.1424286058675108, 0.1334546123841824, -0.46011565527018106, -0.3585937541277546, -0.32544295364728526, -0.2960478076908522, -0.27082120964613726, -0.25027775739681096, -0.2349427585777765, -0.2257378077141014, -0.23723690680097456, -0.018097729075609966, -0.13105624771436203, -0.6058653724131675, -0.7286792796416189, -0.7531734117912707, -0.759539411681589, -0.7692434952402634, -0.655505552558073, -0.6961945653150302, -0.42307701925429175, -0.36430247678961647, -0.33377026409619104, -0.5923884541171036, -0.6153729885666551, -0.945112159163389, -0.4234664723421453, -0.7669508516711822, -0.7452471423384762, -0.765718108508397, -0.7668278695961644, -0.765743764966961, -0.7621580064679319, -0.7548185754133969, -0.7429361710469776, -0.7508468891568205, -0.7111225121504892, -0.663359904621823, -0.6553549696787436, -0.5357915130882077, -0.6714826563630073, -0.7414835130573296, -0.7144607600675593, -0.7037467273062983, -0.7053979807562533, -0.6879088258466404, -0.6461948132528945, -0.6496278520362624, -0.6139700735216541, -0.5548001238619013, -0.4485934054583485, -0.24940678649620157, 0.08286024969483442, 0.43667333565553845, 0.6712177029766162, 0.8399552129482587, 0.7712147579502001, 0.7538074156483286, 0.7117214137929088, 0.6654932730259504, 0.6279777893588586, 0.5857014575094877, 0.5385774325967498, 0.48656990299753555, 0.4296572272861732, 0.3678622663813962, 0.30131472918703345, 0.23032960691370385, 0.15547931107283028, 0.07760517240824145, 0.0022984016861823694, -0.4527876022388323, 0.28921009858233626, 0.43017358844763653, 0.6791747293300094, 0.23895869198767045, 0.2542127250108773, 0.2669173414972606, 0.2707386592166978, 0.2660311269329853, 0.2523062520159171, 0.3385690602430013, 0.151528692607993, 0.1740234016621567, 0.16344788147817663, 0.16237231076321, 0.4191922992057452, 0.44785923929588123, 0.45392745443000654, 0.45171978264309, 0.43744936032231846, 0.36719171949849233, 0.3044584671838442, 0.2791835624667633, 0.2518233015366746, 0.22564650653529372, 0.193507015642412, 0.1549028496907878, 0.10473730592293962, 0.06728272244807783, -0.11337251760049029, -0.34836357632067705, -0.36163159500170694, -0.49468983678856726, -0.6104219366958195, -0.712932409239861, -0.7666445105496491, -0.8315857048669242, -0.7540008522307309, -0.5787359948906604, -0.7562773603278455, -0.7673076706666292, -0.7779354214839714, -0.7887193874221533, -0.8000832919798424, -0.8122756091494443, -0.8253336448339269, -0.839039276570091, -0.8525546175193985, -0.8485482620751033, -0.749072787390615, -0.7865603336704339, -0.4512409143138245, 0.13731195803989793, 0.4520490928033925, 0.13362745715810675, 0.6463574171379303, 0.8666377060847391, 0.8665336467175067, 0.8677117963773605, 0.8687076188507274, 0.8688029980262009, 0.8687336324036643, 0.8517418305352864, 0.8589135926614215, 0.8565907281824254, 0.8524388969080976, 0.8486579713227485, 0.860985740140847, 0.7373618126401296, 0.7634146599782469, 0.138267209456899, 0.7593659870529452, 0.7685173618052283, 0.72644013829083, 0.8570753805959669, 0.8530140732883571, 0.8610150751143582, 0.8536585216598287, 0.8238913236552835, 0.7236697510762927, 0.4409185640458162, -0.010135343693614567, -0.3449705944461237, -0.5192491685105817, -0.5833415309318508, -0.6161198909320411, -0.518312377882219, -0.5441038697174293, -0.6340582421598743, -0.8469538481572563, -0.7414102722845082, -0.8721336894116654, -0.443803362497605, -0.8105063018153521, -0.5139511366041377, -0.8422284862868142, -0.8622788331319073, -0.8103664063703008, -0.5415379371754449, -0.298117584471244, -0.5116684649404387, -0.4796305576846967, 0.4137985630131267, -0.6370130020130405, -0.7611798468584318, -0.6115216629075959, -0.6127557362590978, -0.6115529969834196, -0.1969056021053552, -0.8370395442029389, -0.7305431823842086, 0.4811735605431272, -0.5951170627219542, -0.5313826198116738, -0.4914570411156656, -0.45662034469358126, -0.4260347992442285, -0.39859944428100214, -0.3732860697048311, -0.30628357159622976, 0.749005984602795, 0.7944645757489003, 0.23467556252980748, 0.7526509427104202, 0.7415164887157564, 0.730427230042764, 0.7201992833274957, 0.710641438891451, 0.701590850720642, 0.6929295198305823, 0.6845808539747498, 0.6140786304387346, 0.9142053953451512, 0.9203326639972773, 0.9167206118367214, 0.9118489091447174, 0.8583900530796545, 0.8632266832669457, 0.8165275045523356, 0.8895937470653208, 0.9073440593285118, 0.9154972212319639, 0.9170004175367052, 0.8691220026761329, 0.8790253973614436, 0.9159148968813748, 0.8696474528104307, 0.8612649988142346, 0.8523977440125418, 0.8435415421618643, 0.8350221844119108, 0.8271710250290787, 0.820304876550503, 0.8147119744768053, 0.7874766470371118, 0.855368306748341, 0.7176711362509005, 0.9214699243786489, 0.6477880961810583, 0.7942572407738642, 0.5731838897751355, 0.8666039455382418, 0.8944493028180522, 0.8930083503983565, 0.9097248742591483, 0.9072398072315369, 0.8960351129960418, 0.7467734980756128, 0.5275497184815532, 0.23175973506824987, -0.4402764399695784, -0.6215094184905388, 0.6875831708217094, 0.926914799445932, 0.20225605672922833, 0.9404676369918632, 0.9365830212798778, 0.9297140385728458, 0.9255329630913609, 0.9287960606438111, 0.9269773953215887, 0.9273448153359802, 0.9203211298766104, 0.8990537093305292, 0.9661210188717381, 0.9497937325813812, 0.9571664254745795, 0.9080444243230362, 0.9645970226044099, 0.4915287331740793, 0.9715094633092819, 0.9711390945132771, 0.9723273402307131, 0.9661398658267218, 0.95557598987738, 0.9738382231994377, 0.966420851212296, 0.9650062709932975, 0.9623261617378408, 0.8452151956221756, 0.9565026020091191, 0.9757262425848074, 0.9420232737948051, 0.9463651676286168, 0.9415380728013553, 0.9777482342537417, 0.751245872259626, 0.9816383260385741, 0.898870857271606, 0.7708660556343611, 0.7440668881464878, 0.7184083409341392, -0.497522011755016, -0.9196449702432248, -0.2599636372489479, -0.8133401407723185, -0.9600070464293174, -0.7767425129780624, -0.9884633302153906, -0.7578110447342189, -0.8939317814804436, 0.11678471068399678, 0.9915095350143696, 0.34264282894183345, 0.3195650124975054, 0.3187486058838728, 0.3392466497206075, 0.8342033590360676, 0.8687111358530955, 0.7760429144634896, 0.831146218656879, 0.8481189316954826, 0.8644233953850687, 0.8799100783077674, 0.8944317680721037, 0.9078933506646412, 0.9202357806366548, 0.8957192192475917, 0.9743277947066511, 0.9588278197242562, 0.9896840828015576, 0.3659464033883905, 0.32231848208658725, 0.290879850458046, 0.26066878773238816, 0.6823177773910523, 0.31297361074716784, -0.30133365103255794, 0.6814292096258256, -0.6126609151612802, -0.919906780623431, -0.4495158746316784, -0.24546011042113083, -0.8151321609825294, -0.18721489857393156, -0.9719960610660606, -0.5791085700082457, -0.5851873852057804, -0.5475014565296097, -0.08114412044936606, 0.24812657982373057, -0.00536467655439976, 0.020279363020605158, 0.04881773656813175, 0.0799987763054057, 0.11343204377275543, 0.14878966208816533, 0.1855401513882775, 0.2206733400308058, 0.5658834926108842, 0.30523789845652627, -0.053413513918261116, 0.3086642840206062, 0.31703679250385863, 0.32428654012450525, 0.3296820449597896, 0.33235232081857913, 0.3315764270811801, 0.3164855917357615, 0.9647201120837263, 0.45314539768056283, 0.9372509040461703, 0.530448780605428, 0.5193253321264398, 0.5086142561409336, 0.49398307290593163, 0.4759844208777301, 0.4126583888848556, 0.36788757281478934, 0.021107080387528405, 0.5190811661396597, -0.5011526318996549, 0.43927511091895394, -0.26647921971787236, 0.39252149068767234, 0.07156687947619295, -0.566413981139629, -0.5793496323902617, -0.5818848773325217, -0.5810427552017651, -0.860755627581876, 0.3428123173045127, 0.7071951041365998, -0.5815631107630167, -0.5482855600223246, -0.5221624380701058, -0.5033226733133301, -0.4893448371914163, -0.47906433171326995, -0.4713823478099588, -0.4627531758912397, -0.31882943348167975, -0.11662798033715098, -0.031508034520929935, 0.004079887090896629, -0.24026276099949742, 0.13664548239961963, 0.4595388844574566, 0.12834986283092736, 0.1042671210764325, 0.05162108274262324, -0.17257056917480612, -0.3648367350932466, 0.10422753470774913, 0.05424968440306332, -0.20847508348735888, -0.22410942455113655, -0.2387333656380209, -0.25225970574455375, -0.26485518051626833, -0.2767805553256037, -0.2880829484837256, -0.715546530047437, -0.20690776726882487, -0.8034760752522343, -0.22382976347290692, 0.1521134927384065, -0.09768755117342287, -0.10478577724788819, -0.11512575439776436, -0.12871729548012775, -0.14562449403260638, -0.16586354910538975, -0.302350319937206, -0.22832004053758803, 0.6340874259199373, 0.6004579051008866, -0.09322322523681392, 0.8282679426501879, 0.8292960099244642, 0.8296644902056143, 0.8295710722669636, 0.8289528084325295, 0.827681936052662, 0.8255102427613605, 0.8219552261278864, 0.8160286152551055, 0.7991260083821327, 0.8260447452239621, 0.7109956043224085, -0.012601779225940688, 0.1359485583149235, 0.34522769093694533, -0.16882414883632227, 0.8029800090210634, -0.04610372352384608, -0.09056745803667125, -0.11486429694600567, -0.13653046428402618, -0.14985701512229743, -0.07039425501591454, -0.15586584963301542, 0.7045320427834744, 0.824033970991946, 0.7002917929291604, 0.786686126620089, 0.803496916902252, 0.7983577388909796, 0.7928986856132701, 0.7963822294612106, 0.8121074844112786, 0.7859158635548137, 0.8062326445224277, 0.7831982908641685, 0.7000498500585325, 0.7595748403275832, 0.752289928526185, 0.7455631699813325, 0.7399089225809925, 0.7354656074410362, 0.7322070593505843, 0.7299815235291016, 0.7285581239193925, 0.7276583936034178, 0.7260647420871209, 0.6090378150126726, 0.6876634395960854, 0.7817205090743072, 0.7188573504765852, -0.47108322573318706, 0.5996915709266942, 0.5698174751211953, 0.9606610966218344, 0.844523624507493, 0.8050229801968909, 0.7826887285873277, 0.7660418935578398, 0.752057327463976, 0.7405149289208425, 0.89057259042703, 0.8822871690216103, 0.8671102599873132, 0.7402385562317331, 0.5682940173748641, 0.7417951325714268, 0.8019422491015608, 0.7210475055997911, 0.8414518816010156, 0.9328476017253821, 0.909579780322904, 0.8999259457338533, 0.89054512326682, 0.9137120844225344, 0.947754873434909, 0.9489095023720042, 0.9493869710320826, 0.43298183691114545, 0.8093171597721527, 0.6333550956827281, 0.8488351031739578, 0.8482794541184827, 0.8621597958873337, 0.8671746262651921, 0.8676666543610984, 0.8670648930164572, 0.8473405711342635, 0.9306108070313177, 0.7996841102884624, 0.9137118622608728, 0.19953266463567754, 0.251368067644534, 0.24392869465402173, 0.23736283082793277, 0.23175757517095896, 0.2269804790795956, 0.22290650442726198, 0.2194379036813123, 0.2164834188755486, 0.32726172067479065, -0.39868327118979796, -0.8862191320825291, -0.8858333595352677, -0.6665114509364376, -0.9749854455267355, -0.7221176831811594, -0.9097444870924504, -0.2654694679013155, 0.1905939464147683, 0.16135816372598064, 0.1303717202303571, 0.1006948108548068, -0.016773764832787325, 0.2714294736071597, 0.8387188944372892, 0.8593918667058905, 0.8430215923705536, 0.8468190742263221, 0.8504800187338083, 0.8534528814665809, 0.8554313548193544, 0.8561442955464694, 0.8547438306014653, 0.8494987648941577, 0.8431229859642506, 0.8360930925270559, 0.41240573438529365, -0.16858978441413117, 0.603428774615165, 0.6344933626250419, 0.7637662835066672, 0.8282492255248953, 0.8511696496423561, 0.8537577746369165, 0.8482809416934338, 0.8407494648251023, 0.8338863087059663, 0.8272942925585188, 0.8094696284137675, 0.7944802624733026, 0.7872328320018794, 0.7826075404252517, 0.7806836058049259, 0.7292297621113838, 0.8335467307317094, 0.7775119219195694, 0.8305925202578817, 0.8499281832777231, 0.8135455708882113, 0.8255705855676266, 0.859842563148567, 0.8554325587291289, 0.8518016059322152, 0.849673709366615, 0.8469408323699146, 0.8435640351178116, 0.8396345476348981, 0.835315104070906, 0.8308305647057226, 0.8264646308985839, 0.8225276932026726, 0.8211953065421754, 0.8449460043554462, 0.8218119517725005, 0.8198132402521271, 0.6593447230914394, 0.8476006298977182, 0.8099948973315794, 0.8649492919407704, 0.8688550895425353, 0.8728148210320847, 0.876113980993807, 0.8615661227506204, 0.4656017173808516, 0.6783469767920367, 0.8344406052228501, 0.591782170169211, 0.615632046458798, 0.6420784407458715, 0.6673738902399389, 0.6904282154427352, 0.7104188564410371, 0.7268475621485608, 0.8617422168311549, 0.0643714471275294, 0.7398365336055253, -0.2320271670882056, 0.6145968052062032, -0.2411532542511743, -0.1992130065470475, -0.2223001261736815, -0.2525924046937248, -0.28750958533191673, -0.3262422003798546, -0.3675417544958939, -0.4119904919297966, -0.06159951022956627, -0.5191031650376947, -0.2709406042929127, -0.6128863837381079, -0.6288270092347763, -0.6313370827069122, -0.5620450811770439, 0.11078404423161398, -0.5185768667825671, -0.7617832081507987, -0.36965475775880186, -0.39437064016530415, -0.444455317837559, -0.3533358727643479, -0.5778034292974503, -0.5420499059445277, -0.6854374439514161, -0.6924581413915543, -0.6993179404041985, -0.7040232838983159, -0.7071229194359211, -0.7099638806360208, -0.7106137316564974, -0.7125433836331477, -0.712523810912827, -0.7128211789642132, -0.7129381644741282, -0.2586569774158008, -0.790275284286044, -0.440017161030395, -0.5787810114139178, -0.6768878588246222, -0.6824037533411759, -0.6874862779205877, -0.6885792457647061, -0.6970258899033552, -0.6736382147545098, -0.34627809729890524, -0.06447379156866427, -0.5182850413083243, -0.5301747842245671, -0.5411822321308117, -0.5507168594418146, -0.5586251242791977, -0.5648665969167997, -0.5691777723535412, -0.6268217083013312, -0.5164376680135246, 0.23388864589854322, -0.5482634031633271, -0.009755031374983155, 0.6234523306231355, 0.314798791499293, -0.47025521686742383, -0.5950944990973401, -0.6139100139134531, -0.5770644267033981, -0.5731930532070673, -0.5694440977399728, -0.566463142959229, -0.56423363084577, -0.5627168309706391, -0.5576366621012323, -0.3597436482743714, -0.5561477094664432, -0.6073870186106525, -0.5620763535351248, -0.6013241101644141, -0.6526241524820776, -0.5888887137839574, -0.4890922215281189, -0.6147241611718223, -0.5859451565580349, -0.5608439592504705, -0.5681787335827266, -0.46045543351506774, -0.31545228571956857, -0.2788875948892913, -0.33613283819896644, -0.31268560227561437, -0.27270215017275157, -0.31626409594120536, -0.32402648409242385, -0.3323498035052321, -0.34123887130402875, -0.3506926813672413, -0.360656215229675, -0.3715401909812042, -0.37869688039195615, -0.7147068376557996, -0.44372313727597357, -0.2737939242754574, -0.4594522036798924, -0.4441487651590685, -0.42866425090524496, -0.4119016483644393, -0.3938486815276309, -0.3745525569605411, -0.3540675314682591, -0.3324078704745227, -0.30994845947129607, -0.2928634877368806, -0.2740675771994247, -0.2544329286486953, -0.24998199899378482, -0.47068230625195406, 0.6707424028499535, -0.28017382090775916, 0.3552827210284857, -0.13975031627238027, 0.29916199829891277, 0.2808091716495403, 0.2772179545878184, 0.38573981763923104, 0.5964656119808319, 0.6784397102427563, 0.7148799897729242, 0.7799080137495453, 0.8027651346389335, 0.7246971713369053, 0.5803914293344982, 0.42117451795107413, 0.11914253462078327, 0.0559866774903359, 0.05875223352014649, 0.08405964133153301, 0.11358228932362491, 0.13149287639086546, 0.14406119118674746, 0.1559801271617909, 0.16836912164812923, 0.18124268441705157, 0.19467510039667701, 0.20870392915717584, 0.22332012889839756, 0.2385810739457841, 0.2545680278602684, 0.2710118647235742, 0.29045021410727984, 0.2934453048561014, 0.2989196937236983, 0.8901791463839988, 0.8512254319640472, 0.5240826695910089, 0.7643903233704827, 0.7652067339381112, 0.7680571379554979, 0.3449934838660464, 0.5969805295163659, 0.30763947182347245, 0.882455142672511, 0.8509350461362027, 0.827097637267108, 0.7962601949539603, 0.7592971592044272, 0.7177491801795073, 0.6735532045269204, 0.6286592299711713, 0.5847293578542967, 0.5170766197660791, 0.49836584421990926, 0.38529051091781497, 0.3215854741386182, 0.480785154970588, 0.4170707167186329, 0.31232923554945424, 0.37870067039323707, 0.36014366229789696, 0.3420523717046136, 0.32423968710982537, 0.5125386009762325, 0.29176713152366374, 0.18475906740732587, 0.252503900050297, 0.23485272020246595, 0.2178771598310522, 0.20117808644444185, 0.18474155825408378, 0.1685830122616285, 0.15253672848040956, 0.13636400841687704, 0.2565743547191514, 0.10250366518842484, 0.029300237954433383, 0.06989786300269663, 0.05879000755433805, 0.04804477844787664, 0.07071512818802772, 0.4945213689600707, 0.04767344014739909, -0.36996678670125827, -0.2571624021575218, 0.006891239916541646, -0.08288474817218623, -0.0061515148572958995, -0.004964098871891524, -0.0075525863257453465, -0.009645412108603773, -0.011253428635181117, -0.012428737067529982, -0.013179369919452752, -0.013796365616368891, -0.008051693322600058, -0.0203383455647789, -0.025228260053848473, -0.017287448086399673, -0.014541557298177238, -0.011893347174994432, -0.008797445460420246, -0.005261038029674196, -0.0013023722014626647, 0.0015029750718182921, -0.001762973904571234, 0.0047607332238261265, 0.012414466971495798, 0.014108769862748753, 0.020929060460131804, 0.02826588903128472, 0.036224635234603765, 0.04469669756398585, 0.05359738943992067, 0.06263672957281251, 0.07913578076985542, 0.08010305154656812, 0.08181395446102437, 0.09903026342278613, 0.1087057563982747, -0.5609844949703192, 0.03801623432203264, -0.6023264714681861, 0.10823805034820855, 0.14748128866094581, 0.1440378180238425, 0.14478594521912672, 0.14603562885617588, 0.14053576483007224, 0.13705280347020204, 0.13310557271106482, 0.1286724945641367, 0.12380180434908987, 0.118522103797585, 0.11349766074381754, 0.10169669429841967, 0.10342419589155852, 0.10289591668212011, 0.08480626472992658, 0.07544011870607002, 0.06621382433297746, 0.05697899282053982, 0.04798303045561257, 0.03564859650587503, -0.019707857108527873, -0.001981722248307092, -0.06313791702194205, 0.008222514939876835, 0.003716564577548402, 0.003553563210239813, 0.00551322506212968, 0.008902335378745473, 0.0136945290956347, 0.019892957012765354, 0.027500130066935385, 0.034841483190687646, 0.05111435380479659, 0.09328416580954903, 0.08252046836519375, 0.09781972850144063, 0.6703040546031889, 0.6860221418118043, 0.6851994386409866, 0.8630559388800619, 0.1448726863983951, 0.19893596632040628, 0.19182511982440212, 0.0792496263109763, 0.13989235994067462, 0.7110788923005359, 0.13799803503182606, 0.14531353200623645, 0.1543174414007244, 0.16495396604514578, 0.1778251144022504, 0.19379241084280474, 0.21377678426159788, 0.23906330829859704, 0.27214449596101914, 0.7349889355612211, 0.4493832853898246, 0.3692506113799992, 0.6426592101093611, 0.8134669755446539, 0.6394118834653347, 0.5899593741870363, 0.5860803868048512, 0.06021426320065182, 0.5594557347814854, 0.6040037625904444, 0.6650146564350052, 0.16576360037465518, 0.8065237774200846, 0.457615495654157, 0.70760958975505, 0.6806256599833446, 0.6378574578303274, 0.5957629019928238, 0.5536970603596496, 0.5107455007636417, 0.8209279775076825, 0.7194113088980508, 0.8394645680036424, 0.7777400413831016, 0.291789250484459, -0.19926137312411313, 0.3794936040943781, 0.19849391573265376, 0.38195707675419494, 0.498433471954952, 0.5805666945510035, 0.6385738502285025, 0.680483623379635, 0.7117684557678692, 0.73601898054017, 0.7427541410666987, 0.5565313856797269, 0.7883281714866716, 0.8785753167160766, 0.7590570034519342, 0.7727042645249321, 0.7967439293698935, 0.8707556813251307, 0.8846607809754294, 0.8702669317583579, 0.8957616656618289, 0.8896243565598994, 0.8757630640534921, 0.8819012690245337, 0.8814656176999603, 0.8489671072864087, 0.8254274331603747, 0.8013593533916326, 0.777141693043289, 0.7537511810177513, 0.7319641171985242, 0.7150230761955869, 0.8231051507901156, 0.762904604501337, 0.7469727663147583, 0.17638778724691437, 0.3530431538490013, 0.21065251597994503, 0.4232057350203953, 0.1909796557223257, 0.17305179567458284, 0.1885886446659305, 0.19947199380072883, 0.19861131773166057, 0.18744901506794753, 0.16775339702674724, 0.14089692937646045, 0.10848951510615816, 0.4752988273398873, 0.1821621972370286, -0.8152851432087151, -0.04978721041793806, -0.07131014368440265, -0.03697061565322492, -0.28901170602610377, -0.3552655365093178, -0.26984946784138214, -0.2965190900775982, 0.26042334914948306, 0.5637070901846567, 0.587244433259327, 0.6140351354687736, 0.30040906042533877, -0.01371595671049527, -0.09148877512289341, -0.11491152864232337, -0.11262907239291951, 0.5666766373478258, 0.6345834897413118, 0.7530432547585197, 0.17741714433814354, 0.11468740303256125, 0.04241012341353197, -0.0555691807203139, -0.1662457531438465, -0.5005080996554663, -0.09244053201723432, -0.47009845905726383, 0.09583160922975201, 0.9068313013045827, 0.9720051677115092, 0.9376618924715602, 0.9838453208034811, 0.18377737423866145, 0.8978612694373893, 0.9586500461851633, 0.9821015674638456, 0.9917437948518703, 0.993344370185048, 0.9908683337704379, 0.9869379648311617, 0.9796367897775876, 0.9840560638358276, 0.6950940927254083, 0.07627649896767541, -0.9735002064470548, -0.9735002064470548, -0.9735002064470548]\n"
     ]
    }
   ],
   "source": [
    "# Example of accessing data in a tube\n",
    "p = list(map(lambda x: tube.GetPoint(x).GetPositionInObjectSpace(), range(tube.GetNumberOfPoints())))\n",
    "r = list(map(lambda x: tube.GetPoint(x).GetNormal1InObjectSpace()[0], range(tube.GetNumberOfPoints())))\n",
    "print(r)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 9,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "application/vnd.jupyter.widget-view+json": {
       "model_id": "29e4b77275c04fd780377f2dda475ba5",
       "version_major": 2,
       "version_minor": 0
      },
      "text/plain": [
       "Viewer(geometries=[], gradient_opacity=0.22, point_sets=[], rendered_image=<itk.itkImagePython.itkImageF3; pro…"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "TubesToImageFilterType = ttk.ConvertTubesToImage[ImageType]\n",
    "tubesToImageFilter = TubesToImageFilterType.New()\n",
    "tubesToImageFilter.SetUseRadius(True)\n",
    "tubesToImageFilter.SetColorByRidgeness(True)\n",
    "tubesToImageFilter.SetTemplateImage(im1vess)\n",
    "tubesToImageFilter.SetInput(tubeG)\n",
    "tubesToImageFilter.Update()\n",
    "\n",
    "outputImage = tubesToImageFilter.GetOutput()\n",
    "view(outputImage)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 10,
   "metadata": {
    "scrolled": true
   },
   "outputs": [],
   "source": [
    "writer = itk.SpatialObjectWriter[3].New()\n",
    "writer.SetFileName(\"vessels.tre\")\n",
    "writer.SetInput(tubeG)\n",
    "writer.Update()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.7.6"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 2
}
